package org.lewis.core.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 用户
 * 
 * @author taiqichao
 * 
 */
@Entity
@Table(name = "LS_USER")
public class User extends BaseDomain {

	private static final long serialVersionUID = 1L;

	/**
	 * 昵称
	 */
	private String nickname;
	/**
	 * 邮箱
	 */
	private String email;
	/**
	 * 密码
	 */
	private String password;
	/**
	 * 手机号
	 */
	private String mobile;
	/**
	 * 状态
	 */
	private String status;

	public User() {
	}

	@Column(name = "NICK_NAME")
	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	@Column(name = "EMAIL")
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "PASSWORD")
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "MOBILE")
	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	@Column(name = "STATUS")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public enum STATUS {
		NONACTIVATED("未激活"), NORMAL("正常"), DISABLE("禁用");

		private String cnName;

		STATUS(String cnName) {
			this.cnName = cnName;
		}

		public String getCnName(String code) {
			String name = "";
			for (STATUS status : STATUS.values()) {
				if (status.name().equals(code)) {
					name = status.cnName;
					break;
				}
			}
			return name;
		}
	}

}
